<!DOCTYPE html>
<html lang="zh-cn">
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>{$CONF['shopTitle']['fieldValue']}后台管理中心</title>
      <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="__CSS__/AdminLTE.css" rel="stylesheet" type="text/css" />
      <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.min.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
      <![endif]-->
      <script src="__PUBLIC__/js/jquery1.11.1.min.js"></script>
      <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
      <script src="__PUBLIC__/js/common.js"></script>
      <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
      <script src="__PUBLIC__/plugins/formValidator/formValidator-4.1.3.js"></script>
      <script src="__PUBLIC__/plugins/kindeditor/kindeditor.js"></script>
      <script src="__PUBLIC__/plugins/kindeditor/lang/zh_CN.js"></script>
      <script type="text/javascript" src="__PUBLIC__/js/ajaxfileupload.js"></script>
      <style>
        .isWinning {display: none;}
      </style>
      <script type="text/javascript" src="__JS__/jedate/jedate.js"></script>
      <style type="text/css">
          li{list-style-type: none; }
          .jedaol{padding: 0px;}
          .botflex{padding: 0px; }
      </style>
      <style type="text/css">
          .pagination li{
              list-style-type: none;
              float:left;
              border:solid 1px #ddd;
              padding: 5px 10px;
              margin-top:0px;
              text-align:center;
          }
      </style>
   </head>
   <script>
   $(function () {
	   KindEditor.ready(function(K) {
			editor1 = K.create('textarea[name="Explanation"]', {
				height:'350px',
				allowFileManager : false,
				allowImageUpload : true,
				items:[
				        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
				        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
				        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
				        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
				        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
				        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|','image','table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
				        'anchor', 'link', 'unlink', '|', 'about'
				],
				afterBlur: function(){ this.sync(); }
			});
		});
	   $.formValidator.initConfig({
		   theme:'Default',mode:'AutoTip',formID:"myform",debug:true,submitOnce:true,onSuccess:function(){
				   edit();
			       return false;
			},onError:function(msg){
		}});
   });
    //保存修改
   function edit(){
	   var params = {};
	   params.fieldCode = $('#fieldCode').val();
     params.Explanation = $('#Explanation').val();
	   Plugins.waitTips({title:'信息提示',content:'正在提交数据，请稍后...'});
	   $.post("{:U('Admin/IntegralGoods/editLottery')}",params,function(data,textStatus){
			var json = WST.toJson(data);
			if(json.status=='1'){
				Plugins.setWaitTipsMsg({ content:'操作成功',timeout:1000,callback:function(){
				   location.href="{:U('Admin/IntegralGoods/toLottery')}";
				}});
			}else if(json.status=='0'){
          Plugins.closeWindow();
        Plugins.Tips({title:'信息提示',icon:'error',content:'请点击上传图片!',timeout:1000});
      }else{
				Plugins.closeWindow();
				Plugins.Tips({title:'信息提示',icon:'error',content:'操作失败!',timeout:1000});
			}
		});
   }
   </script>
   <body class="wst-page">
       <form name="myform" method="post" id="myform" autocomplete="off">
        <input type='hidden' id='fieldCode' value='{$lotteryExplanation.fieldCode}'/>
        <table class="table table-hover table-striped table-bordered wst-form">   
           <tr>
             <th align='right'>抽奖说明<font color='red'>*</font>：</th>
             <td>
             <textarea id='Explanation' name='Explanation' style='width:80%;height:400px;'>{$lotteryExplanation['fieldValue']}</textarea>
             </td>
           </tr>
           <tr>
             <td colspan='2' style='text-align: center'>
                 <button type="submit" class="btn btn-success">保&nbsp;存</button>
             </td>
           </tr>
        </table>
       </form>
   </body>
</html>